package com.qfedu.fmmall.controller;

import com.qfedu.fmmall.service.CategoryService;
import com.qfedu.fmmall.service.IndexImgService;
import com.qfedu.fmmall.service.ProductService;
import com.qfedu.fmmall.vo.ResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/index")
@Api(value = "提供首页数据显示所需的接口",tags = "首页管理")
public class IndexController {
    @Resource
    private IndexImgService indexImgService;
    @Resource
    private CategoryService categoryService;
    @Resource
    private ProductService productService;
    @GetMapping("/indeximg")
    @ApiOperation("⾸⻚轮播图接⼝")
    public ResultVO listIndexImgs(){
        return indexImgService.listIndexImgs();
    }
    @GetMapping("/category-list")
    @ApiOperation("商品分类查询接口")
    public ResultVO listpage(){
        return categoryService.listpage();
    }
    @GetMapping("/list-recommends")
    @ApiOperation("新品推荐商品接⼝")
    public ResultVO listRecommendProducts(){
        return productService.listRecommendProducts();
    }
    @GetMapping("category-recommends")
    @ApiOperation("分类推荐商品接⼝")
    public ResultVO recommends(){
        return categoryService.recommends();
    }
}
